<?php
/*
 * @Author: 李志刚
 * @CopyRight: 2022-2099 李志刚（854378082@qq.com）
 * @Date: 2020-09-20 20:37:41
 * @Description: 系统配置修改
 * @LastEditors: 李志刚
 * @LastEditTime: 2022-04-21 16:35:29
 * @FilePath: /CoinCMF/app/Http/Controllers/Console/Common/ConfigController.php
 */


namespace App\Http\Controllers\Console\Common;

use App\Models\Common\Config;
use App\Http\Controllers\Controller;
use App\Http\Requests\Cms\ConfigRequest;

class ConfigController extends Controller
{
    public function getDetail()
    {
        $detail = Config::findOrFail(1);
        return $this->resJson(200,'成功',$detail);
    }
    public function postEdit(ConfigRequest $request)
    {
        $data = ['sitename'=>$request->input('sitename'),'description'=>$request->input('description'),'person'=>$request->input('person'),'phone'=>$request->input('phone'),'email'=>$request->input('email'),'address'=>$request->input('address')];
        Config::where('id',1)->update($data);
        return $this->resJson(200,'成功');
    }
}
